package JavaGuide;

public class TestException {
    public static void main(String[] args) {
        try {
            System.out.println("finally一定会执行吗");
            throw new RuntimeException("运行时异常");
        }catch (Exception e){
            String msg=e.getMessage();
            String string = e.toString();
            System.out.println(msg+string);
            System.exit(0);//提前停止虚拟机
        }finally {
            System.out.println("finally执行了");
        }
    }
}
